import axios from 'axios'

//封装axios
let instance = axios.create({
  baseURL: 'http://localhost:8001/boss',
  timeout: 5000
//   相当于加个前缀，实例可以多个
})


//封装doGet方法
function doGet(url, data) {
  return instance({
    url: url,
    method: 'GET',
    params: data
  })
}

//封装doPost方法
function doPost(url, data) {
  return instance({
    url: url,
    method: 'post',
    data: data
  })
}

export { doGet, doPost }